﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
    <head>
        <meta content="Innovasys Document! X (http://www.innovasys.com)" name=GENERATOR>
        <!--DXMETADATA start type="MetaCharset" --><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><!--DXMETADATA end-->
        <!--DXMETADATA start type="PageItemTitle" format="<title>Overview</title>" --><title>CommandBarActions Collection</title><!--DXMETADATA end-->
        <link href="stylesheets/axstylesheet.css" type=text/css rel=stylesheet>
        <script src="script/ax.js" type=text/javascript>
    </script>

    


<style>
html,div { margin: 0; padding: 0;}

body {
	padding: 0px;
	margin: 0px;
	overflow: auto;
	height: 100%;
}

#winchm_template_button{
	float: right;
	width: 93px;
	top: 7px;
	position: relative;
	text-align: right;
	right: 5px;
	height: auto;
}

#winchm_template_top{
	padding: 0px;
	margin: 0px;
	border-bottom: 1px solid #9B9B9B;
	background-color: #B1CEFE;
}

#winchm_template_navigation{
	margin: 0px;
	padding-top: 7px;
	padding-left: 7px;
	padding-bottom: 3px;
	padding-right: 0px;
	font-size: 8.5pt;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	color: #585858;
}

#winchm_template_title{
	margin: 0px;
	padding-top: 4px;
	padding-left: 7px;
	padding-bottom: 7px;
	padding-right: 0px;
	font-size: 18px; 
	font-family: Verdana, Geneva, sans-serif;
	color: #363636;
}

#winchm_template_content{
	margin-top: 20px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	width: auto  !important;
	width: 100%;
}

#winchm_template_footer{
	border-width: 1px;
	border-color: #B1CEFE;
	border-top-style: solid;
	margin-top: 15px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	padding-top: 7px;
	padding-left: 0px;
	padding-bottom: 0px;
	padding-right: 0px;
	font-family: arial, helvetica, sans-serif;
	font-size: 8.5pt;
	color: #696969;
	width: auto;
	text-align: left;
}


#winchm_template_container{
	margin: 0px;
	padding: 0px;
	position: static;
	padding-bottom: 3px;
	overflow: auto;
	background-color: #FFFFFF;
}


@media print
{
#winchm_template_container{
	position: static;	
	margin: 0px;
	padding: 5px;
	
	width: auto;
	height: auto;
	overflow: auto;
}
#winchm_template_button{
visibility:hidden;
}
}

#winchm_template_navigation A:link	{text-decoration: none; color:#004080}
#winchm_template_navigation A:visited  {text-decoration: none; color: #004080}
#winchm_template_navigation A:active {text-decoration: none; color: #004080 }
#winchm_template_navigation A:hover {text-decoration: none;color: #0080FF}

A:link	{text-decoration: underline; color:#0033CC}
A:visited  {text-decoration: underline; color: #0033CC}
A:active {text-decoration: underline; color: #0033CC }
A:hover {text-decoration: underline;color: #FF0000;}
</style>
<script type="text/javascript">
function isMobile(){
Agent = window.navigator.userAgent;
if (Agent.indexOf("iPhone")>=1 || Agent.indexOf("iPad")>=1 || Agent.indexOf("iPod")>=1 || Agent.indexOf("Android")>=1){
return true;
}else{
return false;	
}

}
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_container').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_container').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_container').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_container').style.width = 'auto';
document.getElementById('winchm_template_container').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

if(!isMobile()){

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;

document.write("<style>\n");
document.write("body {overflow: hidden;}\n");
document.write("#winchm_template_container {position: absolute;overflow: auto;top : 0px;right: 0px;bottom: 0px;left: 0px;}\n");
document.write("</style>\n");
}

</script>
</head>
    <body><script language="JavaScript" type="text/JavaScript">
function syn(){
if(parent.nav.tree){
 if(parent.nav.tree.loaded){
  parent.nav.tree.selectNode(4066);
 }else{
  setTimeout("syn()",500);
}
  }else{
  setTimeout("syn()",500);
  }}
if(parent!=self){
  setTimeout("syn()",100);
}else{
  parent.location.href = "../index.htm?page=XtremeCommandBars~CommandBarActions.html";
}
originalOnload = window.onload;
if(originalOnload==null){
window.onload = function(){parent.contentLoaded = true;};
}else{
window.onload = function(){originalOnload();parent.contentLoaded = true;};
}
</script> 


<div id="winchm_template_top">
	<div id="winchm_template_button"><A href="XtremeCommandBars~CommandBarActions.html" title="Previous topic"><img id="winchm_template_prev" alt="Previous topic" src="template2/btn_prev_n.gif" border="0"></a><A href="XtremeCommandBars~CommandBarActions_members.html" title="Next topic"><img id="winchm_template_next" alt="Next topic" src="template2/btn_next_n.gif" border="0"></a></div>
	<div id="winchm_template_navigation">Help &gt; 
<A href="welcome_screen.htm">Codejock ActiveX Controls v15.3</A> &gt; <A href="XtremeCommandBars_P.html">Xtreme Command Bars</A> &gt; Objects &gt; <A href="XtremeCommandBars~CommandBarActions.html">CommandBarActions Collection</A> &gt; </div>
	<div id="winchm_template_title">Overview</div>
</div>
<div id="winchm_template_container">
	<div id="winchm_template_content"><div class=popupbubble id=dxseealsomenu><p id=dxseealsocontent><a href="#Bookmark4067">CommandBarActions Members</a>
</p><!--DXMETADATA end --> 
        </div>
        <div id=pagetop>
            <div id=projectnamebanner>
                <table class=projectnametable cellspacing=0>
                    <tbody>
                        <tr>
                            <!--DXMETADATA start type="Literal" condition="childitems:itemtype=seealso" value="<td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td>" --><td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td><!--DXMETADATA end -->
                            <td>
                                <!--DXMETADATA start type="Phrase" Name="Product_Header" -->Xtreme Command Bars ActiveX Control v15.3<!--DXMETADATA end --> 
                            </td>
                            <td align=right>
                                <!--DXMETADATA start type="Variable" name="FeedbackLink" format="" --><!--DXMETADATA end -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id=pagetitlebanner>
                <h1 class=dxh1>
                <!--DXMETADATA start type="PageItemTitle" -->CommandBarActions Collection<!--DXMETADATA end --></h1>
            </div>
        </div>
        <div id=pagebody valign="bottom">
            <!--DXMETADATA start type="IsNew" format="<script>document.all.pagebody.className = 'newTopic'</script>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Description" source="Item" format="<h4 class=dxh4>$$Description$$</h4><p>%%description%%</p>" --><h4 class=dxh4>Description</h4><p>Collection of <A href="#Bookmark4047">CommandBars Action items</A> that have been added to the CommandBars.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Scrap" name="_MEMBERS_LINK" format="<p>%%scrap%%</p>" --><p>For a list of all members defined in this module, see <a href="#Bookmark4067">CommandBarActions members</a>.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Diagram" source="item" format="<h4 class=dxh4>$$OBJECT_MODEL$$</h4><p>%%Diagram%%</p>" --><h4 class=dxh4>Object Model</h4><p><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD NOWRAP>
<a href="#Bookmark4065"><img src="cDiagramImages/XtremeCommandBars~CommandBarActions~126.gif" border=0></a><img src="cDiagramImages/paracros.gif" border=0><a href="#Bookmark4047"><img src="cDiagramImages/XtremeCommandBars~CommandBarAction~126.gif" border=0></a>
</TD></TABLE>
</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##MODULE_REMARKS" format="<h4 class=dxh4>$$Remarks$$</h4><p>%%comment%%</p>" --><h4 class=dxh4>Remarks</h4><p><P>The <STRONG>CommandBarActions Collection</STRONG> allows you to add and access <A href="#Bookmark4047">CommandBars Action items</A>&nbsp;to your CommandBars.</P>
<P>&nbsp;</P>
<P>CommandBar Actions eliminate the need to use the <A href="#Bookmark4729">Update</A> event to update\change the state and properties of an item that appears multiple places in your menus and toolbars.&nbsp; For example, you might have a menu item that also appears in a toolbar, then a user might have created the same button and placed it in a user created toolbar.&nbsp; With <STRONG>Actions</STRONG> you can simply modify the action for the item and it will update all occurences of the item, no matter how many a user might have added.</P>
<P>&nbsp;</P>
<P>Actions also work good for localization as you can have a set of actions for each local that can easily be used to update all occurences of items ensuring that all items get updated.</P>
<P>&nbsp;</P>
<P><STRONG>How it works</STRONG>:</P>
<P>Each CommandBar&nbsp;item has an Id.&nbsp; Items with the same Id can then share a common set of properties.&nbsp; A <A href="#Bookmark4047">CommandBars Action</A>&nbsp;object, represented as "Item Actions" in the diagram below,&nbsp;is a set of properties that all items of a specified Id can share.&nbsp; When you <A href="#Bookmark4069">add an Action</A> you will specify the Id, Caption, TooltipText, DescriptionText, and Category of the action.&nbsp; The Id is the Id&nbsp;you will assign to CommandBar&nbsp;items that you cant to use the properties of the action.&nbsp; Now any CommandBar item with the same Id as an Action will use the properties of the action.&nbsp; When updating any property of the action it will automatically update all occurences of the item, no matter how many a user might have added, if it is in a popup menu, or in a toolbar.&nbsp; You will no longer have to use the <A href="#Bookmark4729">Update</A> event to update\change the state and properties of an item that appears multiple places in your menus and toolbars.</P>
<P>&nbsp;</P>
<P><A href="#Bookmark4659">EnableActions</A>&nbsp;must be called to enable actions to be used.&nbsp; Each CommandBar Item has an Action property which is just a reference to the <A href="#Bookmark4047">CommandBars Action item</A>&nbsp;that is associated with it.&nbsp; If no action is added for an item or actions have not been enable the default properties of the item will be used.</P>
<P>&nbsp;</P>
<P>In the diagram below, the "Menu Item," "Toolbar Item" and "User Customized Item (user created toolbar)" all share the same "Item Action."&nbsp; When you modify the properties of the action it will update all occurences of the item.<!--DXMETADATA end--></P>
<P><IMG src="Pictures/actions.gif" border=0></P></p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="ITEM_LIST_WITH_HEADER" namespace="implemented interface" source="Item" filter="" format="<h4 class=dxh4>$$Interfaces$$</h4>%%filtereditemlist%%" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##MODULE_EXAMPLEINTRO" format="<h4 class=dxh4>$$Example$$</h4><p>%%comment%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="INLINE_EXAMPLE" namespace="Example" source="Item" filter="type=inline" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$Example$$</h4>,format= %%%%filtereditemlist%%" --><h4 class=dxh4>Example</h4><DIV Class=LanguageSpecific Name=Example_VB><p><SPAN class="lang">[Using CommandBar Actions (Visual Basic)]</SPAN>&nbsp;This sample illustrates how to use CommandBar Actions to update the properties of items that appear in multiple places in your commandbars.</p><DIV Class=LanguageSpecific Name=Code_VB><TABLE Class="CodeContainerTable" CellPadding="0" CellSpacing="0" Border="0"><TR><TD NOWRAP><CODE Class="VB">&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Enable the use of actions</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.EnableActions<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Create Actions to be used by CommandBar items.  You can create the action before</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'or after the CommandBar Items are added, but if you create them before like this sample</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'be sure not to overwrite any of the 5 properties of the actions when the CommandBar</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'item is added.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions.Add ID_FILE_NEW, <font class='string'>&quot;&New&quot;</font>, <font class='string'>&quot;New&quot;</font>, <font class='string'>&quot;Create a new document&quot;</font>, <font class='string'>&quot;File&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions.Add ID_FILE_OPEN, <font class='string'>&quot;&Open&quot;</font>, <font class='string'>&quot;Open&quot;</font>, <font class='string'>&quot;Open an existing document&quot;</font>, <font class='string'>&quot;File&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions.Add ID_FILE_SAVE, <font class='string'>&quot;&Save&quot;</font>, <font class='string'>&quot;Save&quot;</font>, <font class='string'>&quot;Save the active document&quot;</font>, <font class='string'>&quot;File&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions.Add ID_FILE_PRINT, <font class='string'>&quot;&Print&quot;</font>, <font class='string'>&quot;Print&quot;</font>, <font class='string'>&quot;Print the active document&quot;</font>, <font class='string'>&quot;File&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions.Add ID_FILE_PRINT_SETUP, <font class='string'>&quot;&Print Setup&quot;</font>, <font class='string'>&quot;Print Setup&quot;</font>, <font class='string'>&quot;Change the printing options&quot;</font>, <font class='string'>&quot;File&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions.Add ID_FILE_CLOSE, <font class='string'>&quot;&Close&quot;</font>, <font class='string'>&quot;Close&quot;</font>, <font class='string'>&quot;Close the active document&quot;</font>, <font class='string'>&quot;File&quot;</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> Control <font class='keyword'>As</font> CommandBarControl<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> ControlFile <font class='keyword'>As</font> CommandBarPopup<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Add some CommandBar items.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, <font class='string'>&quot;&File&quot;</font>)<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>With</font> ControlFile.CommandBar.Controls<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_NEW, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_OPEN, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_SAVE, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> Control = .Add(xtpControlButton, ID_FILE_PRINT, <font class='string'>&quot;&quot;</font>)<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Control.BeginGroup = <font class='keyword'>True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_PRINT_SETUP, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> Control = .Add(xtpControlButton, ID_FILE_EXIT, <font class='string'>&quot;&quot;</font>)<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Control.BeginGroup = <font class='keyword'>True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>End</font> <font class='keyword'>With</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> ToolBar <font class='keyword'>As</font> CommandBar<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> ToolBar = CommandBars.Add(<font class='string'>&quot;Standard&quot;</font>, xtpBarTop)<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>With</font> ToolBar.Controls<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_NEW, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_OPEN, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add xtpControlButton, ID_FILE_SAVE, <font class='string'>&quot;&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Set</font> Control = .Add(xtpControlButton, ID_FILE_PRINT, <font class='string'>&quot;&quot;</font>)<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Control.BeginGroup = <font class='keyword'>True</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>End</font> <font class='keyword'>With</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Disable ALL items with Id ID_FILE_SAVE</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions(ID_FILE_SAVE).Enabled = <font class='keyword'>False</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Change the DescriptionText of ALL items with Id ID_FILE_PRINT</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions(ID_FILE_PRINT).DescriptionText = <font class='string'>&quot;Print the current document to a file&quot;</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'Change the ToolTipText of ALL items with Id ID_FILE_OPEN</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;CommandBars.Actions(ID_FILE_OPEN).ToolTipText = <font class='string'>&quot;Open an existing document&quot;</font></CODE></TD></TR></TABLE></DIV></DIV>
<!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="seealso" source="Item" filter="" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$See_Also$$</h4><p id=dxseealsocontent>%%filtereditemlist%%</p>" --><h4 class=dxh4>See Also</h4><p id=dxseealsocontent><a href="#Bookmark4067">CommandBarActions Members</a>
</p><!--DXMETADATA end --><!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="example" source="Item" filter="type=linked" NoHeader="True" NoFooter="True" format="><!--DXMETADATA end --><!--DXMETADATA start type="Variable" name="CopyrightNotice" format="><!--DXMETADATA end --></div></div>	
	<div id="winchm_template_footer">Copyright &copy; 2018. All rights 
reserved. (To change the copyright info, just edit it in template.)</div>
</div>

</body>
</html>

